package com.zrrd.spring_04;

import com.alibaba.druid.pool.DruidDataSource;
import com.zrrd.spring_04.config.SpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.swing.*;
import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author WanJl
 * @version 1.0
 * @title Main
 * @description
 * @create 2024/10/31
 */
public class Main {


    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        DruidDataSource dataSource = context.getBean("druidDataSource", DruidDataSource.class);
        System.out.println(dataSource.getUrl());
        System.out.println(dataSource.getPassword());
        Scanner scanner = context.getBean(Scanner.class);
        System.out.println(scanner);

        ArrayList arrayList = context.getBean(ArrayList.class);
        System.out.println(arrayList);
    }
}
